package org.dao.imp;
import java.util.List;
import org.dao.XsDao;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.model.Xsb;
public class XsDaoImp implements XsDao{
 public Xsb getOneXs(String xh){
	 try{
		 Session session=org.util.HibernateSessionFactory.getSession();
		   Transaction ts=session.beginTransaction();
		   Query query=session.createQuery("from Xsb where xh=?");
		   query.setParameter(0,xh);
		   query.setMaxResults(1);
		   Xsb xs=(Xsb) query.uniqueResult();
		   ts.commit();
		   session.clear();
		   return xs;
	 }catch(Exception e){
		 e.printStackTrace();
		 return null;
	 }
 }
 public void update(Xsb xs){
	 try{
		 
	 }catch(Exception e){
		 e.printStackTrace();
	 }
 }
}
